import React, { Component } from 'react'

export default class Input extends Component {
    keyUp = e=>{
        if(e.keyCode === 13){
            this.props.add(e.target.value)
            e.target.value = ''
        }
    }
    render() {
        return (
            <div>
                <input onKeyUp = {this.keyUp} placeholder = "请输入目标。。。"/>
            </div>
        )
    }
}
